<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<html>
<head>
<title>待审流程管理</title>
<%@include file="/common/ec.jsp"%>
<%@include file="/common/extjs.jsp" %>
<%@include file="/common/meta.jsp"%>
<script type="text/javascript">
</script>
</head>
<body>
<div class="x-panel">
<div class="x-panel-header">【借款】项目审批管理</div>
<div class="x-toolbar">
  <table width="99%">
        <tr>
        <s:form action="borrowProjectIndex" theme="simple" id="form1">
	      <td width="60">审批状态：</td>
	      <td width="90"><s:select list='auditStatusMap' name="model.status" cssStyle="width:80px" headerKey="" headerValue="全部"></s:select></td>        
          <!--<td width="220">借款单号：<s:textfield name="singleNo" cssStyle="width:150px;" /></td>-->
          <td width="60">开始日期：</td>
          <td width="100"><input id="startDate" name="startDate" size="12" value="<s:date name='startDate' format='yyyy-MM-dd'/>" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'endDate\')}',skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" class="Wdate"  readonly="readonly"/>&nbsp;&nbsp;</td>
          <td width="60">结束日期：</td>
          <td width="100"><input id="endDate" name="endDate" size="12" value=" <s:date name='endDate' format='yyyy-MM-dd'/>" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startDate\')}',skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" class="Wdate"  readonly="readonly"/></td>
          <td><s:submit value="查询" cssClass="button" cssStyle="width:45px;"></s:submit></td>
        </s:form>
        </tr>
      </table>
</div>
<div class="x-panel-body">
<ec:table items="items" var="item" retrieveRowsCallback="limit" sortRowsCallback="limit" 
	    action="borrowProjectIndex.do"
		useAjax="true" doPreload="false"
		maxRowsExported="10000000" 
		pageSizeList="15,50,100" 
		editable="false" 
		sortable="false"	
		rowsDisplayed="15"	
		generateScript="true"	
		resizeColWidth="true"	
		classic="false"	
		width="100%" 	
		height="400px"	
		minHeight="400"
		toolbarContent="navigation|pagejump|pagesize|refresh|extend|status">
	<ec:row>
	    <ec:column width="30" property="_s" title="No." value="${GLOBALROWCOUNT}" sortable="false" style="text-align:center"/>
		<ec:column width="120" property="_singleNo" title="借款单号" ellipsis="true">
		   <a href="${ctx}/borrow/view.do?model.id=${item.flow.borrow.id}" target="_blank"><font color="blue">${item.flow.borrow.singleNo}</font></a>	
		</ec:column>
	    <ec:column width="130" property="flow.borrow.project.name" title="项目名称" ellipsis="true"/>			
	    <ec:column width="100" property="flow.borrow.item.name" title="财务科目" ellipsis="true"/>		    			
	    <ec:column width="65" property="flow.borrow.borrower.name" title="借款人" style="text-align:center"/>	
		<ec:column width="75" property="flow.borrow.createDate" title="借款时间" style="text-align:center" cell="date"/>
		<ec:column width="70" property="flow.borrow.amount" title="借款金额" style="text-align:right" format="#####0.00" cell="number"/>
        <ec:column width="110" property="auditorNames" title="审批人员" style="text-align:center" ellipsis="true"/>			
		<ec:column width="70" property="status" title="审批状态" style="text-align:center" mappingItem="auditStatusMap">
		  <s:if test="#attr.item.status == 'pending'"><font color="#999999">未审核</font></s:if>
		  <s:if test="#attr.item.status == 'pass'"><font color="green">已通过</font></s:if>
		  <s:if test="#attr.item.status == 'nopass'"><font color="red">未通过</font> </s:if>
		</ec:column>				
		<ec:column width="80" property="_0" title="操作" style="text-align:center" sortable="false">
		   <s:if test="#attr.item.status != 'pending'"> <font color="#999999">审批</font>|</s:if>
		   <s:else><a href="${ctx}/flow/node/borrowAudit.do?model.id=${item.id}">审批</a> |</s:else>	   
		    <a href="${ctx}/borrow/view.do?model.id=${item.flow.borrow.id}" target="_blank">查看</a>	
		</ec:column> 
	</ec:row>
</ec:table>
</div>
</div>
<script type="text/javascript">

function refresh() {
  ECSideUtil.reload('ec');
}
</script>

</body>
</html>